package configuration;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Enumeration;
import java.util.Properties;


public class BaseOperations {

	protected static String value = null;
	static String xmlFileName = "configuration.xml";
	protected static String listOfProjectsFileName;
	protected static String listOfFramesFileName;

	
	
	@SuppressWarnings("rawtypes")
	public String getConfiguration
				(String typeOfProperty) {
		try {
			FileInputStream fileInput = new FileInputStream(xmlFileName);
			Properties properties = new Properties();
			properties.loadFromXML(fileInput);
			fileInput.close();
					
			Enumeration enuKeys = properties.keys();
			while (enuKeys.hasMoreElements()){
				
				String propertyFile = (String) enuKeys.nextElement();
				if (propertyFile.matches(typeOfProperty)){
					value = properties.getProperty(propertyFile);
					}
		   	}
		}
			catch (IOException e) {
				e.printStackTrace();
				}
		return value;
		
		
	}

	public BaseOperations() {
		super();
	}

}